package com.diankangwo.dao.impl;

import com.diankangwo.dao.PropertyDAO;
import com.diankangwo.domain.Property;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Repository
public class PropertyDAOImpl extends BaseDaoImpl<Property> implements PropertyDAO {

    @Override
    public List<Property> findByClassificationId(Integer id) {
        List<Property> proList = new ArrayList<Property>();
        proList =  findByQuery("from Property pro where pro.speciesId = ?", id);
        if (proList == null || proList.size() ==0) {
            return null;
        }else{
            return proList;
        }
    }
}
